import Vue from 'vue'
import Router from 'vue-router'
import home from '../views/home'
import login from '../views/login/login'
import name from '../views/name/autoname'
import mymqtt from '../views/mqtt/mymqtt'
import gmqtt from '../views/mqtt/gmqtt'
import devList from '../views/mqtt/devList'
import lightDetail from '../views/mqtt/lightDetail'
import deviceInfo from '../views/mqtt/deviceInfo'
import mytest from '../views/mqtt/mytest'
import time_range_set from '../views/mqtt/time-range-set'
import monitor from '../views/mqtt/monitor'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/home',
      name: 'home',
      component: home
    },
    {
      path: '/',
      name: 'login',
      component: login
    },
    {
      path: '/name',
      name: 'name',
      component: name
    },
    {
      path: '/mymqtt',
      name: 'mymqtt',
      component: mymqtt
    },
    {
      path: '/gmqtt',
      name: 'gmqtt',
      component: gmqtt
    },
    {
      path: '/devList',
      name: 'devList',
      component: devList,
      meta: {
        keepAlive: true // 需要被缓存
      }
    },
    {
      path: '/lightDetail',
      name: 'lightDetail',
      component: lightDetail,
      meta: {
        keepAlive: true // 需要被缓存
      }
    },
    {
      path: '/deviceInfo',
      name: 'deviceInfo',
      component: deviceInfo,
      meta: {
        keepAlive: true // 需要被缓存
      }
    },
    {
      path: '/mytest',
      name: 'mytest',
      component: mytest
    },
    {
      path: '/time-range-set',
      name: 'time-range-set',
      component: time_range_set
    },
    {
      path: '/monitor',
      name: 'monitor',
      component: monitor
    }
  ]
})
